// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI  from 'element-ui'
import store  from './store/index'
import 'element-ui/lib/theme-chalk/index.css';
// import $axios  from './commen/http'

Vue.use(ElementUI);
// Vue.use(axios);

// Vue.prototype.$axios = $axios;

// router.beforeEach((to, from, next) => {
//   // 修改页面title，to是即将进入的路由对象，包含paht、meta等信息
//   document.title = to.meta.title
//   // 判断是否登录，是否有权限
//   let userInfo = localStorage.uersInfo('user');
//   if(userInfo) {
//     // 已经登录
//     next()
//   }else {
//     // 没有登录
//     if(to.path === '/login') {
//       next()
//     }else if(to.path != '/login') {
//       next('/login');
//     }
//   }
  
// })
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
